<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>有一个长度为100的数组，值为其所在位置的索引</title>
</head>
<body>
<script type="text/javascript">
    var a = new Array(100);
    /*方法1*/
    // a = a.join(",").split(",").map(function(item, index) {
    //     return index;
    // });
    /* 方法2 */
    // for (var i =0 ; i < 100; i++){
    //     a[i] = i
    // }
    console.log(a)
</script>
</body>
</html>